package cn.e4j.modular.api.service;

import cn.e4j.core.dto.impl.Dto;
import cn.e4j.core.util.ToolUtil;
import cn.e4j.modular.api.mapper.AzyyMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 服务预约
 */
@Service
public class AzyyService{
    @Autowired
    AzyyMapper azyyMapper;

    /**
     * 获取已购设备列表
     *
     * @param inDto
     * @return
     */
    @Transactional(readOnly = true)
    public List<Dto> getListData(Page<Object> page,Dto inDto) {

        return azyyMapper.getListDataPage(page,inDto);
    }

    @Transactional(readOnly = true)
    public String getGwam007(Dto indto){
        List<Dto> dto = azyyMapper.getGwam007(indto);
        return ToolUtil.isNotEmpty(dto)?dto.get(0).getString("GWAM007"):"";
    }

    @Transactional(readOnly = true)
    public Dto getGwal(Dto indto){
        List<Dto> list = azyyMapper.getGwal(indto);
        return ToolUtil.isEmpty(list)?null:list.get(0);
    }


}
